#ifndef _SOCKDATA_H_
#define _SOCKDATA_H_

#include <queue>
using namespace std;

#include "SyncObj.h"
typedef struct __netpack
{
	unsigned short len;
	char* pData;
}NetPack;

class CSockData
{
public:
	int readBufStartPos;
	int readBufEndPos;
	char readBuf[cReadBufSize];
	char tempreadBuf[cReadBufSize];

	int writeBufStartPos;
	int writeBufEndPos;
	char writeBuf[cWriteBufSize];
	char tempWriteBuf[cWriteBufSize];

	CSyncObj m_readSyncObj;
	CSyncObj m_writeSyncObj;

	queue< NetPack > m_readQueue;
	queue< NetPack > m_writeQueue;

	CSockData();
	~CSockData();

	void WriteData(char* pData, unsigned short dataLen);
	void PushWriteNetPack( NetPack& netPack );
	NetPack PopWriteNetPack();
	void FillWriteData();
};





#endif